package libra.openfeign.fallback;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Component;

@Component
public class OpenFeignLocalFallbackImpl implements OpenFeignLocalFallback {
	private static final Map info = Map.of("from", "OpenFeignLocalFallbackImpl");
	
	@Override
	public Object exec() {
		Map copyOf = new HashMap(info);
		copyOf.putAll( Map.of("method", "exec_fallback()", "fallBackMsg", "") );
		return copyOf;
	}
	@Override
	public Object timeout() {
		Map copyOf = new HashMap(info);
		copyOf.putAll( Map.of("method", "timeout_fallback()", "fallBackMsg", "执行超时，被fallback处理") );
		return copyOf;
	}
	@Override
	public Object ex() {
		Map copyOf = new HashMap(info);
		copyOf.putAll( Map.of("method", "ex_fallback()", "fallBackMsg", "执行异常，被fallback处理") );
		return copyOf;
	}
}
